package com.yoomiito.app.ui.anyview.sureorder.header

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import com.yoomiito.app.R
import com.yoomiito.app.model.bean.GoodsDetail
import com.yoomiito.app.model.my.MyRemainMoneyInfo
import com.yoomiito.app.utils.DensityUtil
import com.yoomiito.app.utils.ImageLoader
import com.yoomiito.app.widget.RoundImageView

class SureOrderGoodsView(context: Context, detail: GoodsDetail):BaseSureOrderHeaderView(context){
    private val goodsView: View = LayoutInflater.from(mContext).inflate(R.layout.item_goods_13,null,false)

    init {
        goodsView.findViewById<TextView>(R.id.goodsPrice).visibility = View.INVISIBLE
        goodsView.findViewById<RoundImageView>(R.id.goodsPic).let{
            ImageLoader.getInstance().into(mContext,detail.pict_url,it)
        }
        goodsView.findViewById<TextView>(R.id.goodsTitle).text = detail.title
        val lp = LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT)
        lp.leftMargin=DensityUtil.dp2px(12f)
        lp.rightMargin=DensityUtil.dp2px(12f)
        lp.topMargin=DensityUtil.dp2px(10f)
        addView(goodsView,lp)
        addMessageView()
    }

    override fun setMoneyInfo(moneyInfo: MyRemainMoneyInfo) {

    }

    override fun recalculateMoney() {

    }
}